<template>
	<view class="rules">
		<uni-list>
			<uni-list-item v-for="(item,index) in ruleList" :key="index" :title="item.name" showArrow
				:to="'/pagesA/my/rules/ruleDetail?type='+(item.type)"></uni-list-item>
		</uni-list>
	</view>
</template>

<script>
	import {
		rules
	} from '@/api/my/my.js';
	export default {
		data() {
			return {
				ruleList: [],
			}
		},
		onLoad() {
			this.getDataList();
		},
		methods: {
			// 列表
			getDataList() {
				rules('agreementList', {}).then(res => {
					let datas = res.data;
					this.ruleList = Object.keys(datas).map((value, key) => {
						return {
							name: datas[value],
							type: value
						}
					})
				}).catch(error => {
					uni.hideLoading();
				})
			},

		}
	}
</script>
<style lang="scss">
	page {
		background-color: #F0F1F2;
	}
</style>
<style lang="scss" scoped>
	@import '../my.scss';

	.rules {
		@include cards;
		background-color: #FFFFFF;
		margin: 30rpx 3%;
		padding: 0 30rpx;

		/deep/ .uni-list--border-top,
		/deep/ .uni-list--border:after,
		/deep/ .uni-list--border-bottom {
			background-color: transparent;
		}

		/deep/ .uni-list-item__container {
			padding: 28rpx 0;
		}

		/deep/ .uni-icon-wrapper {
			padding: 0 0 0 20rpx;
		}
	}
</style>
